{extend name="base/index"/}
{block name="page_location"}
<div class="row">
	<div class="col-12">
		<div class="page-title-box">
			<div class="page-title-right">
				<ol class="breadcrumb m-0">
					<li class="breadcrumb-item"><a href="{:url('index/index')}">管理中心</a></li>
					<li class="breadcrumb-item active"><i class="iconfont icon-angle-right"></i>友情链接分类管理</li>
				</ol>
			</div>
			<h4 class="page-title">
				所有友情链接分类
				<a href="javascript:;" data-toggle="modal" data-target="#new_box" id="add_weblink_dig" class="btn btn-success btn-sm ml-3">创建友情链接分类</a>
			</h4>
		</div>
	</div>
</div>
{/block}

{block name="body"}          
<div class="row" id="weblink_class_page">
	<div class="col-12">
		<div class="card">
			<div class="card-body">
				<table class="table table-hover">
				    <thead>
				        <tr>
				            <th>ID</th>
				            <th>分类名</th>
				            <th>描述</th>
				            <th>分类图片</th>
				            <th>更新时间</th>
				            <th>操作</th>
				        </tr>
				    </thead>
				    <tbody>
				        {volist name='list' id="data"}
				            <tr>
				                <td>{$data.id}</td>
				                <td>{$data.classname}</td>
				                <td>{$data.description}</td>
				                <td><img class="list_facepic preview_img" src="{$data.picurl|default='/static/admin/images/nopic.png'}" /></td>
				                <td><span class="badge badge-primary">{$data.posttime|date="Y-m-d H:i",###}</span></td>
				                <td>
				                    <a href="javascript:;" class="btn btn-primary btn-sm edit_btn" attr-id="{$data.id}" data-toggle="modal" data-target="#new_box"><i class="iconfont icon-icon_compile"></i> 修改</a>
				                    <a href="javascript:;" class="btn btn-danger btn-sm Fast_Del"  attr-id="{$data.id}"  attr-model="weblinkclass"><i class="iconfont icon-icon_delete_fill"></i> 删除</a>
				                </td>
				            </tr>
				        {/volist}
				    </tbody>
				</table>
				<div class="row">
					<div class="col-12" style="text-align: center;">
						{$pagelist}
					</div>
				</div>	
			</div>
		</div>
	</div>
</div>
<!-- END PAGE CONTENT-->
{/block}
{block name="modal_dig"}
	<!-- END CONTAINER -->
    <!-- Modal -->
    <div class="modal fade" id="new_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-full-700">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title dig_title" id="myModalLabel">创建友情链接分类</h4>
            <button type="button" class="close" data-dismiss="modal">x</button>			
          </div>
          <div class="modal-body">
                <form action="#" class="form-horizontal" id="edit_weblink_class_frm">
                	<input type="hidden" name="id" value="" />
                    <div class="form-group row mb-1">
                        <label class="col-3 col-form-label">分类名：</label>
                        <div class="col-5">
                            <input type="text" name="classname" placeholder="请输入分类名" class="form-control ipt_check" data-type="string" data-len="1-100" nullmsg="分类名不能为空" errormsg="分类名由1-100个字符组成！"  value="">
                        </div>
						<div class="col-2">
							<span class="font-13 text-muted">必填</span>
						</div>							
                    </div>
	                <div class="form-group row mb-1">
	                    <label class="col-3 col-form-label">分类图片：</label>
	                    <div class="col-5 picurl_pc_box">
		                    <div class="picurl" data-type="upload" attr-inputname="picurl" nullmsg="PC图片没有上传" attr-value=""  isCompress="1"></div>
	                    </div>
	                </div>
                    <div class="form-group row mb-1">
                        <label class="col-3 col-form-label">分类描述：</label>
                        <div class="col-5">
                            <textarea class="form-control" name="description" rows="3"></textarea>
                        </div>
                    </div>                   
                </form>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
            <button type="button" class="btn btn-primary Fast_Form_Post" attr-frm="#edit_weblink_class_frm" attr-callback="reload" attr-model="weblinkclass" attr-active="save_weblink_class">保存</button>
          </div>
        </div>
      </div>
    </div>
{/block}